package common.impl;

import java.util.List;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import common.interf.IResultTranslate;

public class ResultTranslateImpl<T> implements IResultTranslate<T> {
	public String toJSONArrResult(List<T> lst,long total) throws Exception{
		JSONArray jarr = new JSONArray();
		for(T t:lst){
			 Class clazz = t.getClass();
			 
			
		}
		JSONObject jret = new JSONObject();
		if(total > 0)
			jret.put("total", total);
		jret.put("rows", jarr);
		return jret.toString();
	}

	
}
